package com.uzai.console.service.feign.impl;

import com.uzai.common.dto.goods.TextConvertGoodsDto;
import com.uzai.console.common.UzaiRespVo;
import com.uzai.console.dto.feign.deviceauth.MobileDeviceAuthAdd;
import com.uzai.console.dto.feign.deviceauth.MobileDeviceAuthDel;
import com.uzai.console.service.feign.ClientApiService;
import com.uzai.console.service.feign.dto.ConvertGoodsDto;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author mingyang.chen create in 2022/11/4 11:37
 */
@Component
public class ClientApiFallbackFactory implements FallbackFactory<ClientApiService> {
    @Override
    public ClientApiService create(Throwable throwable) {
        return new ClientApiService() {
            @Override
            public UzaiRespVo<ConvertGoodsDto> convertGoods(TextConvertGoodsDto convertGoodsDto) {
                return UzaiRespVo.fail();
            }

            @Override
            public UzaiRespVo<Object> mobileDeviceAuthAdd(MobileDeviceAuthAdd mobileDeviceAuthAdd) {
                return UzaiRespVo.fail();
            }

            @Override
            public UzaiRespVo<Object> mobileDeviceAuthDel(MobileDeviceAuthDel mobileDeviceAuthDel) {
                return UzaiRespVo.fail();
            }

        };
    }
}
